from flask import Flask
import config
from exts import db,mail
from models import  UserModel
from blueprints.qa import bp as qa_bp
from blueprints.auth import bp as auth_bp
from flask_migrate import Migrate
app = Flask(__name__)

# 绑定配置文件，自动加载配置信息
app.config.from_object(config)

# db和app进行绑定
db.init_app(app)
mail.init_app(app)
migrate = Migrate(app, db)

# register_blueprint是将蓝图对象 bp 注册到应用程序对象 app 上
app.register_blueprint(qa_bp)
app.register_blueprint(auth_bp)




if __name__ == '__main__':
    app.run()
